<?php
if (isset($errorMessage)) {
	echo '<p class="error">', $errorMessage, '';
}
if (isset($invited_by)) {
	echo '<p class="help">Looks like you\'ve been invited by a friend!  If you\'d like some extra information on who we are, go ahead and check out our "Want to Join" page ', $html->link('here', '/pages/signup'), '.</p>';
}
echo $form->create();
?>
<h3>New Member Information</h3>
<p class="required">Required Info</p>
<fieldset>
<legend>User info</legend>
<?php
if (isset($invited_by)) {
	echo $form->hidden('invited_by', array('value' => $invited_by));
}
?>
<?=$form->input('username', array('div'=>array('class' => 'input text required')));?>
<span id="check"></span>
<?=$ajax->observeField('MemberUsername',array('url'=>'/members/checkUsername','update'=>'check'));?>
<?=$form->input('password', array('div'=>array('class' => 'input password required')));?>
<?=$form->input('passcheck',array('type'=>'password', 'label'=>'Password (again)', 'div'=>array('class' => 'input text required')));?>
</fieldset>
<fieldset>
<legend>Personal Info</legend>
<?=$form->input('first_name', array('div'=>array('class' => 'input text required')));?>
<?=$form->input('last_name', array('div'=>array('class' => 'input text required')));?>
<?=$form->input('email_address', array('div'=>array('class' => 'input text required')));?>
<?=$form->input('home_phone', array('div'=>array('class' => 'input text required')));?>
<?=$form->input('work_phone');?>
<?=$form->input('mobile_phone');?>
<?=$form->input('fax');?>
</fieldset>
<fieldset>
<legend>Alternate Contact (all optional)</legend>
<?=$form->input('first_name_2');?>
<?=$form->input('last_name_2');?>
<?=$form->input('email_address_2');?>
</fieldset>
<fieldset>
<legend>Home Address</legend>
<?=$form->input('address_line1');?>
<?=$form->input('address_line2');?>
<?=$form->input('city');?>
<?=$form->input('state');?>
<?=$form->input('zip');?>
<?=$form->input('county');?>
</fieldset>
<fieldset>
<legend>Account Info</legend>
<?=$form->input("no_postal_mail", array('label' => "Don't send me postal mail."));?>
<?=$form->input('volunteer', array('label'=>'I am available to volunteer.'));?>
</fieldset>
<input name='reset' type='reset' value='Clear form'>
<?=$form->end('Register'); ?>